﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 练习10
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers = new int[10];
            for (int i = 0; i < numbers.Length; i++)
            {
                Console.Write("请输入" + $"数字{i + 1}/10:");//输入数据
                numbers[i] = Convert.ToInt32(Console.ReadLine());//添加数据到数组
            }
            int temp = numbers[0];
            for (int j = 0; j < numbers.Length - 1; j++)
            {
                for (int k = 0; k < numbers.Length - 1 - j; k++)
                {
                    if (numbers[k] > numbers[k + 1])
                    {
                        temp = numbers[k + 1];
                        numbers[k + 1] = numbers[k];
                        numbers[k] = temp;
                    }
                }
            }
            Console.Write("数组排序为：");
            foreach (var item in numbers)
            {
                Console.Write(item + "");
            }
            Console.ReadKey();
        }
    }
}
